﻿using System;
using System.Text;
using System.Drawing;
using System.Collections.Generic;

namespace gKodes.Drawing
{
    public class SolidPaint : IPaint
    {
        private System.Drawing.Color mColor;

        private SolidBrush mBrush;

        private Pen mPen;

        System.Drawing.Color IPaint.Color
        {
            get { return this.mColor; }
        }

        public Brush Brush
        {
            get { return this.mBrush; }
        }

        public Pen Pen
        {
            get { return this.mPen; }
        }

        public SolidPaint(System.Drawing.Color icolor)
        {
            this.mColor = icolor;
            this.mBrush = new SolidBrush(this.mColor);
            this.mPen = new Pen(this.mBrush);
        }

        #region Operator overload's

        public static explicit operator System.Drawing.Color(SolidPaint color)
        {
            return color.mBrush.Color;
        }

        public static explicit operator SolidPaint(System.Drawing.Color icolor)
        {
            return new SolidPaint(icolor);
        }

        #endregion
    }
}
